<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<script src="/wondershare/js/ajaxfileupload.js"></script>
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
<title>导入文章Excel管理</title>
<script>
function ajaxFileUpload()
{

  var Ary = $("#excel_file").val().split('.');
  var  filetype = Ary[Ary.length-1];
  if (filetype != 'xls') 
  {
     alert ('请上传xls不加密的文件！');
     return false;
  }else
  {
      
		$.ajaxFileUpload
		(
			{
				url:'/wondershare/guide_excel.php?action=file_upload',
				secureuri:false,
				fileElementId:'excel_file',
				dataType: 'json',
				success: function (data, status)
				{
					alert(data.msg);
					if(data.error == 0)//判断是否上传成功
					{
			
					   $("#is_upload").val('1');//设置已经上传文件
					   $("#filename").val(data.filename);
					}else
					{
					  $("#excel_file").val('');
					}
				}
			}
		)	 
	   return false;
	}
 } 
 
function check_submit()
{

  if($("#excel_file").val() == "")
  {
      alert('请先上传文件！');
      return false;
  }
  if($("#is_upload").val() == "0")
  {
       alert('请先上传文件！');
      return false;
  }
  if($('#web_name').val()== "0")
  {
      alert('选择网站类型！');
      return false;
  }
  return true;
}
</script>
</head>
<body>
<h1>
<span class="action-span1">
<a href="">导入文章Excel管理</a>
</span> 

<span class="action-span">
<a href="/wondershare/guide_excel.php?action=download">下载导入文章Excel模板</a>
</span> 
<div style="clear:both"></div>
</h1>
<div id="tabbody-div"  style=" width:1100px;">
      <form  name="theForm" method="post" action="" onsubmit="return check_submit();">
        <table align="center" width="90%" id="general-table">
          <tbody>
		  <tr>
            <td class="label"><span style="color:#FF0000">请先下载标准Excel模板！</span></td>
           <td ><a href="/wondershare/guide_excel.php?action=download">下载标准模板</a></td>
          </tr>
		  
		  <tr>
            <td class="label">上传文件：</td>
            <td>
			
			<input id="excel_file" type="file" size="60" name="excel_file" > &nbsp;<input type="button"  value=" 上传 " onclick="ajaxFileUpload();" name="sub_from" style="cursor:pointer;"> &nbsp;&nbsp; &nbsp;&nbsp; <span style="color:#FF0000">请先上传没有加密xls格式的文件</span></td>
          </tr>
		  <tr>
            <td class="label">*网站类型：</td>
            <td><select name="web_name" id="web_name">
			<option value="0" selected="selected"  >网站类型</option>
			<option value="ws" >wondershare</option>
			<option value="am" >aimersoft</option>
			<option value="any" >anypdftools</option>
			<option value="app" >applemacvideo</option>
			<option value="jp" >wondershare.jp</option>
			<option value="de" >www.wondershare.de</option>
			<option value="sp" >spotmau</option>
			<option value="is" >iskysoft</option>
			<option value="fr" >wondershare.fr</option>
			<option value="es" >wondershare.com.br</option>
			<option value="mx" >wondershare.com.mx</option>
			<option value="br" >wondershare.com.br</option>
			</select>
	        </td>
          </tr>   
        </tbody></table>

        <div  style="margin-left:380px; margin-top:20px;">
		  <input type="hidden" name="is_upload" id="is_upload" value="0" />
		  <input type="hidden" name="filename" id="filename" value="" />
          <input type="submit"   class="button" value=" 导入  " name="sub_from" style="cursor:pointer;">
          <input type="reset" class="button" value=" 重置 ">
        </div>
      </form>
    </div>
</body>
</html>